package com.springboot.sba.D5_MySql.service;


import com.springboot.sba.D5_MySql.dao.LogRecordMapper;
import com.springboot.sba.bean.LogRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * @description:
 * @author: ZZZ
 * @time: 2021/6/8 21:11
 */

public class MyServiceDemo {
    @Autowired
    public LogRecordMapper logRecordMapper;
    List<LogRecord> list;
    boolean b=false;
    int n=0;

    //@Scheduled(cron = "0/20 * * * * ?")
    public void test() {
        boolean b=true;
        while(b){
            int i = logRecordMapper.zzzD();
            if(i<1){
                b=false;
                break;
            }
            System.out.println(i);
        }
        System.out.println("jiesu");
    }


    //@PostConstruct
    public void getData(){
        List<LogRecord> in=new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            LogRecord logRecord=new LogRecord();
            logRecord.setUuid(""+i);
            logRecord.setBsn("fdsf");
            in.add(logRecord);
        }
        logRecordMapper.zzzbatchInsert(in);
    }

}
